# encoding:utf-8
from flask import Flask, render_template, url_for, request, json, jsonify


app = Flask(__name__)
#设置编码
app.config['JSON_AS_ASCII'] = False


#接收参数，并返回json数据
@app.route('/sendjson', methods=['GET', 'POST'])
def form_data():

   #从request中获取表单请求的参数信息
   title = request.form['title']
   datetime = request.form['datetime']
   quiz = request.form['quiz']

   #此处逻辑代码已经省略...................

   return jsonify({'status': '0', 'errmsg': '登录成功！'})


#测试入口
@app.route('/test')
def hello_world():
    return 'Hello World!'


if __name__ == '__main__':
    app.run(port=8085,host='0.0.0.0')
